/*
*
* SysUserAndRoleMapper.java
* Copyright(C) 2017-2020 fendo公司
* @date 2018-07-13
*/
package com.mass.core.sys.userrole.dao;

import com.mass.core.sys.role.model.SysRole;
import com.mass.core.sys.userrole.model.SysUserAndRole;
import com.mass.core.sys.userrole.model.SysUserAndRoleExample;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

@Mapper
public interface SysUserAndRoleMapper {

    /**
     *  批量添加角色
     * @param userId   用户ID
     * @param sysRoleList  角色集合
     * @return
     */
    int insertByBatch(@Param("userId") Long userId,@Param("sysRoleList") List<SysRole> sysRoleList);

    /**
     *
     * @mbg.generated
     */
    long countByExample(SysUserAndRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int deleteByExample(SysUserAndRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int deleteByPrimaryKey(Long id);

    /**
     *
     * @mbg.generated
     */
    int insert(SysUserAndRole record);

    /**
     *
     * @mbg.generated
     */
    int insertSelective(SysUserAndRole record);

    /**
     *
     * @mbg.generated
     */
    List<SysUserAndRole> selectByExample(SysUserAndRoleExample example);

    /**
     *
     * @mbg.generated
     */
    SysUserAndRole selectByPrimaryKey(Long id);

    /**
     *
     * @mbg.generated
     */
    int updateByExampleSelective(@Param("record") SysUserAndRole record, @Param("example") SysUserAndRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int updateByExample(@Param("record") SysUserAndRole record, @Param("example") SysUserAndRoleExample example);

    /**
     *
     * @mbg.generated
     */
    int updateByPrimaryKeySelective(SysUserAndRole record);

    /**
     *
     * @mbg.generated
     */
    int updateByPrimaryKey(SysUserAndRole record);
}